<template>
    <!-- 按钮 -->
    <div>
        <!--新增-->
        <el-button
            v-if="apis.add"
            class="filter-item"
            type="primary"
            @click="buttonEvent('addEdit')"
            icon="el-icon-plus"
            size="medium"
        >{{ $t('page.system.button.add') }}</el-button>

        <template v-if="buttonItems.length > 0">
            <el-button
                v-for="item in buttonItems"
                :key="item.key"
                class="filter-item"
                :type="item.type || 'primary'"
                :icon="item.icon"
                @click="buttonEvent(item.key)"
                size="medium"
            >{{ item.label }}</el-button>
        </template>
    </div>
</template>

<script>
    export default {
        name: "buttonbasic",
        props: {
            buttonItems: {
                type: Array,
                default() {
                    return [];
                }
            },
            apis: {
                type: Object,
                default() {
                    return {};
                }
            },
            exportLoading: {
                type: Boolean,
                default() {
                    return false;
                }
            }
        },
        data() {
            return {};
        },
        methods: {
            buttonEvent(e) {
                this.$emit("buttonEvent", { eventName: e });
            }
        }
    }
</script>

<style scoped>

</style>
